package com.ai.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ai.web.service.CommentTryUseService;
import com.ai.web.vo.CommentTryUseV;
import com.ai.web.vo.ResultModel;
import com.tiny.persistence.domain.CommentTryUse;
import com.tiny.persistence.repository.CommentTryUseRepo;

@Service
public class CommentTryUseServiceImpl extends BaseServiceImpl<CommentTryUse, Integer, CommentTryUseV> implements CommentTryUseService  {

    @Autowired
    private CommentTryUseRepo commentTryUseRepo;
    
    @Autowired
    public CommentTryUseServiceImpl(CommentTryUseRepo commentTryUseRepo) {
        super(commentTryUseRepo);
    }

    public CommentTryUseV getCommentTryUse(int userId) throws Exception {
        return getT(userId);
    }

    public ResultModel saveCommentTryUse(CommentTryUseV commentTryUseV) throws Exception {
        
        CommentTryUseV saveV = saveT(commentTryUseV);
        
        ResultModel rm = new ResultModel();
        rm.setData(saveV);
        rm.setSuccessCode();
        
        return rm;
    }

    public ResultModel deleteCommentTryUses(List<Integer> userIds) throws Exception {
        deleteTs(userIds);
        
        ResultModel rm = new ResultModel();
        rm.setSuccessCode();
        rm.setMsg("删除成功！");
        
        return rm;
    }

}
